package com.my.study.service;

import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
import org.springframework.security.core.Authentication;

import javax.servlet.http.HttpServletRequest;

/**
 * 自定义权限校验
 * <p>{@link ExpressionUrlAuthorizationConfigurer.AuthorizedUrl#access(String)}使用
 *
 * @author Carlos
 * @version 1.0.0
 * @date 2022/1/9 9:15
 */
public interface CustomPermissionService {

    /**
     * 判断权限
     *
     * @param request:
     * @param authentication:
     * @return boolean
     * @author Carlos
     * @date 2022/1/9 9:19
     */
    boolean hasPermission(HttpServletRequest request, Authentication authentication);

}
